home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
1,000 Game Levels 2
/
1,000 Game Levels 2.iso
/
DOSRPG
/
V1_1CUBE.ZIP
/
CUBE.DOC
next >
Wrap
Text File
|
1991-10-28
|
17KB
|
313 lines
INTRODUCTION
Some years ago, a type of puzzle which is in the shape of a
cube became enormously popular across the country. The cube is
named after its inventor, a Hungarian mathematician named "Rubik".
It is a cube consisting of a number of smaller cubes. Each of the
six square faces of the cube is broken up into nine smaller
squares. The six faces are each a different color.
The cube can be thought of as being broken up along each of
its three axes into three separate "slices". The separations
between the slices intersect, and conceptually separate the
complete cube into 27 smaller cubes. The cube itself is not
designed to separate, and though it gives the appearance of being
composed of a collection of smaller cubes, in reality there is
only the complete cube.
The cube can be mixed by turning any of the faces around its
corresponding axis, or by turning one of the "center slices" in
relation to the two faces between which it is sandwiched. Once
the cube becomes sufficiently "jumbled", it is virtually
impossible to solve it without having an orderly method by which
it may be solved. The trouble is that such a solution is far from
being intuitively obvious. Many people bought the cube and were
unable to solve it, and just threw it aside. Chances are that you
might have one in your closet which you have been unable to solve.
This program will enable you to solve it.
A caveat: if a cube has at some point been disassembled and
then reassembled indiscriminately, there is a 91.7% chance that it
is out of alignment and will not solve. Moreover, if the stickers
on the face have been taken off and re-pasted on indiscriminately,
the cube is almost surely even more than simply misaligned -- it
is likely that even with realignment the cube will not solve.
THE PROGRAM
CUBE.EXE (and the accompanying programs) is a program which
is capable of solving any cube which has been genuinely jumbled
(i.e., only by turning the faces and, generally, not by
disassembly). There are actually four programs included in this
package. CUBE is the standard program which requires a color
monitor capable of displaying at least 16 colors.
RCUBE.EXE is a version of the same program which is designed
to run on systems which have monitors that can display only 8
colors. These are low-cost monitors of CGA resolution. VGA, EGA,
and even most CGA color monitors are capable of displaying at
least 16 colors. In the RCUBE implementation, yellow is mapped as
purple (or magenta). If the yellow and the orange faces appear
identical when you run CUBE, then try RCUBE.
MCUBE.EXE is a version designed to run on monochrome
monitors. This is admittedly a less than optimal implementation.
"Colors" are rendered as letters, which represent corresponding
colors. "B" is blue, "Y" is yellow, etc.
SCUBE.EXE is also a monochrome version, but it is for systems
where a monochrome monitor is attached to a display card which is
recognized as a color card by the system hardware. If you have a
monochrome monitor and MCUBE does not work for you, SCUBE should
work instead.
These programs all run in text mode. Mouse support is
included without any necessary flags, command line arguments, or
an installation procedure. If a mouse is present (and its driver
is loaded), the mouse is automatically detected. A saved cube can
be specified on the command line when the program is run, and this
cube will be loaded into the program's memory. If there is a
problem reading this saved file, a small message will be displayed
on the title screen.
THE SCREEN
When this program is executed, a representation of a cube
"unfolded" is displayed on the screen. Think of the cube as a
box. The bottom of the box is cut out and set to the right. You
are looking at it from the inside out. (Or, alternately, think of
it as if you are actually looking at a reflection of the back side
of the cube in a mirror.) The top of box is in the center of the
screen, and the sides are "folded out" as if the edges of the
sides of the box were cut.
Any of the faces or slices of the cube can be turned, and
this movement will be reflected on the screen. But in order to
have user interface where the user can manipulate the screen, it
is necessary to have a method by which we can refer to particular
faces.
At the top left of the screen is a three-dimensional left-
handed X,Y,Z coordinate axis. The X axis runs horizontally with
positives to the right (as usual), the Y axis runs vertically with
positives above the X axis, and the Z axis runs perpendicular to
the XY plane, with positives to the front of it (i.e, on the same
side as the user). On color screens the axis labels (X+, X-,
etc.) are shown in the color of the center square of the
corresponding face.
Three slices of the cube turn around each of the three axes.
The X- slice is to the left of the center face on the screen, and
comprises the left face. The X+ slice is to the right of the
center face, and comprises the right face. The Y+ slice is above
the center face, and comprises the top face. The Y- slice is
below the center face, and comprises the bottom face. The Z+
slice is the center face on the screen, and comprises the front
face. The Z- slice is far to the right of rest of the cube, and
comprises the rear face.
In addition, there are three other slices which sit between
the faces. We can call them the X0 slice, which is between the
left and right faces; the Y0 slice, which is between the top and
bottom faces; and the Z0 slice, which is between the front and
rear faces.
THE KEYBOARD
The keyboard is divided into several sections. The row of
numbers, from 1 to 9, will turn the entire cube varying degrees
around one of the axes. The row of letters from Q to O will turn
the positive face of one of the three axes varying degrees. The
row of letters from A to L will turn the center slice of one of
the three axes varying degrees. The row of letters from Z to M,
and also the comma and period, will turn the negative face of one
of the three axes varying degrees.
The keys can be divided into three sections corresponding to
the X, the Y, and the Z slices. The 1 key, the 2 key, and the 3
key, and the letter keys which fall directly under these keys
control the 'X' slices. The 4 key, the 5 key, and the 6 key, and
the letter keys which fall directly under these keys control the
'Y' slices. The 7 key, the 8 key, and the 9 key, and the letter
keys which fall directly under these keys control the 'Z' slices.
The keys under the 1 key, the 4 key, and the 7 key, will turn
its corresponding slice one quarter turn counterclockwise, and the
number key will turn the entire cube one quarter turn
counterclockwise around its corresponding axis. The keys under
the 2 key, the 5 key, and the 8 key, will turn its corresponding
slice one half turn, and the number key will turn the entire cube
one half turn around its corresponding axis. The keys under the 3
key, the 6 key, and the 9 key, will turn its corresponding slice
one quarter turn clockwise, and the number key will turn the
entire cube one quarter turn clockwise around its corresponding
axis. "Clockwise" and "counterclockwise" for the slices of the
cube in this context are determined by their relation to the XYZ
"axes".
You will notice that there are columns of letters to the left
of the left face and bottom face, and also a row of letters under
the bottom slice. These correspond to command which will turn
that slice. By highlighting these commands with the mouse cursor
and hitting the left mouse button, you can execute these commands.
Actually, there is no "location" check done on the mouse cursor
when it is above the last line. When the left button is clicked
above ANY letter on the screen -- except for those on the bottom
row (the command menu) -- the corresponding command will be
executed.
At the top right of the screen are three lines of text that
indicate which numbers will turn the cube around which axis. The
message on the bottom right of the screen differs somewhat between
the color and monochrome versions. In the color version, the left
part shows the colors of the aforementioned columns and row of
letters, and the direction that they will turn their corresponding
slice of the cube. The right part shows, again, the color of the
center square of each corresponding face according to its axis.
In the monochrome versions, the message on the bottom right spells
out the color of the center square of each corresponding face
according to its axis.
The faces are referred to by the color of their center
square. The center squares always remain in the same position in
relation to each other. For example, when we say "the yellow
face", we are referring to the face whose center square is yellow.
THE MENU LINE
The last line at the bottom of the screen is the menu line.
There are 10 menu choices which correspond to the first ten
"Function" keys (F1 to F10). These choices can be selected either
by pressing the corresponding function key, or (if a mouse is
present) by pressing the left mouse button while bring the mouse
cursor on the appropriate choice.
F1: SOLVE -- This choice will solve the cube (if indeed it is
unsolved). The moves can be displayed "instantly" (in
reality it does take a finite amount of time to solve the
cube), with a 0.5 second delay between moves, or displaying
instructions on the next move to be made, asking for a key
press before the next move. Should the cube be found to be
out of alignment, a message will be displayed accompanied by
an obnoxious beep, asking for a key press. After the key
press, a fully solved cube will be displayed.
When the cube is solved, a message to this effect will be
displayed, asking for a key press. If the "Escape" key is
pressed while the cube is being solved or in response to this
message, you will be returned to the original unsolved cube.
Unless you pressed the "Escape" key, you will additionally,
be asked for filenames for "instruction" and "script" files
if you have turned this on. The menu line is turned off
while the cube is being solved.
F2: SCRIPT -- This choice will run a "script" file. This file
consists of a sequence of moves that has been previously
saved. Additionally, any file can be run as a "script" file
to randomly jumble the cube. There is a limit of 1024
characters for a script file. If you specify a file that is
longer than 1024 bytes, only the first 1024 bytes will be
read.
Instruction files can be saved while running a script, and
the script can be run with or without a delay, or displaying
instructions of the next move on the screen. No script file
can be made, and if the switch indicating that one is to be
made is turned on, it will be turned off. If there are any
characters in the script buffer, you will be asked to name
the script file about to be saved. (Pressing the "Escape"
key cancels the pending save.) You may press the "Escape"
key at any time to abort the script while it is running, up
to (and including) the time when the message indicating the
script has finished is displayed. Pressing the "Escape" key
will return to the previous cube before the script was run.
F3: SVSCR -- "Save Script". This key controls a "toggle" bit,
indicating whether a script will be saved. Initially, this
switch is off, and is indicated by a minus sign. If it is
switched on, a plus sign takes the place of the minus sign.
If it is switched off while there are characters in the
script buffer, you will be prompted for a filename in which
to store this characters as a script file. Pressing the
"Escape" key will cancel the save operation.
F4: LOAD -- Loads file storing the state of the cube that has
been previously saved. You will be prompted for a filename.
Pressing the "Escape" key will cancel the load operation. If
there is a problem reading the specified file, an error
message will appear. Only files saved with the SAVE command
can be reloaded. Script files or instruction files are not
saved cube files.
F5: SAVE -- Save the current state of the cube to a file. You
will be prompted for a file name. Pressing the "Escape" key
cancels the save operation.
F6: SHOW -- Show the instructions to the screen for moves that
are made either in solving the cube or in following a script
file. A minus sign after the word indicates this option is
off, and a plus sign indicates that it is on. Instructions
will appear at the bottom of the screen, and you will be
prompted to press a key. Pressing the "Escape" key will
abort the current operation and return the cube to the state
it was in before that operation was started.
F7: FILL -- "Fill" the faces to correspond to an existing cube.
This is the procedure you will need to use in order to solve
a cube that you have. If you have a mouse, a new menu line
will appear at the bottom of the screen indicating the
different color choices. (You will notice that the mouse
cursor is now confined to the menu line.) The current square
to be filled will be blinking, and as each square is filled,
the blinking square advances. You may choose the color for
this square either by hitting its first letter on the
keyboard, or by bringing the mouse cursor to the appropriate
color and pressing the left button.
The squares are filled only from the center face, and the
cube rotates as each face is filled. You may keep track of
this by lining up the center squares of each filled face with
your own cube. (Please bear in mind that the back face --
the one at the far right of the screen -- represents a
reflection of that face, i.e., as it would look in a mirror.)
If you make a mistake, you can back up by pressing the
backspace key. (This is also the "REDO" selection on the
mouse menu.) If you hit backspace at the first square to be
fill, you will be returned to the previous cube before you
hit the "FILL" command.
When the cube is completely filled, a message will be
displayed asking for a key press. Hitting backspace will
back up and let you change the last square entered. You may
backspace all the way back through the fill procedure to the
state of the cube before you hit the fill command. Hitting
the "Escape" key at any time up to and including the key
press prompt will return you to the previous cube. (Mouse
users will also note this command on the menu line.)
F8: FILE -- Save the instructions for the sequence of moves that
was made to a file. A minus sign after the word indicates
this option is off, and a plus sign indicates that it is on.
The sequence of moves can either be the operation that solves
the cube, a script operation, or a sequence of moves entered
manually through the keyboard or mouse. You are prompted for
a filename to save the instructions in when an operation
(solve or script) ends, when you have entered moves manually
with this option on and you initiate either the solution or
the script operation, when you toggle this option off and
there are instructions stored in the instruction buffer, or
when the instruction buffer fills up. Hitting the "Escape"
key at the filename prompt cancels the save. The instruction
buffer is about 15K bytes in size.
F9: INSTNT/DELAY -- This key toggles between these two choices.
It switches on or off a one-half second delay between
successive moves. This only has meaning in the solution and
script operations when the "show" option is turned off.
F10: EXIT -- Self explanatory.